/**
 * Copyright (c) 2018-2028, HQY 胡庆一 (215218393@qq.com).
 * <p>
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.gnu.org/licenses/lgpl.html
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.ocm.product.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ocm.core.mp.support.Query;
import com.ocm.core.secure.BladeUser;
import com.ocm.order.dto.OrderDetailDTO;
import com.ocm.product.dto.SpuDTO;
import com.ocm.product.dto.SpuSearchDTO;
import com.ocm.product.entity.Spu;
import com.ocm.product.vo.SpuDetailVO;
import com.ocm.product.vo.SpuSearchVO;
import com.ocm.product.vo.SpuVO;
import com.ocm.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.io.IOException;
import java.util.concurrent.ExecutionException;

/**
 *  服务类
 *
 * @author HQY
 * @since 2021-11-18
 */
public interface ISpuService extends BaseService<Spu> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param spu
	 * @return
	 */
	IPage<SpuVO> selectSpuPage(IPage<SpuVO> page, QueryWrapper<SpuVO> queryWrapper);

	SpuVO getSpuVo(Long id);

    boolean saveProduct(SpuDTO spuDTO, BladeUser bladeUser);

	boolean putaway(SpuVO spu);

    IPage<SpuSearchVO> searchSpu(SpuSearchDTO search, Query query) throws IOException;

	void soldOut(Long spuId);

    SpuDetailVO detail(Long spuId) throws ExecutionException, InterruptedException;

    OrderDetailDTO getOrderData(Long skuId);
}
